<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="test"></div>

  <!-- 引入react核心库，这个库必须最先引入 -->
  <script src="./js/react.development.js"></script>
  <!-- 引入react-dom，用于支持react操作dom -->
  <script src="./js/react-dom.development.js"></script>
  <!-- 引入babel，将jsx转化为js -->
  <script src="./js/babel.min.js"></script>

  <script type="text/babel">
    const data = ['Vue', 'React', 'Anglar']

    const VDOM = (
      <div>
        <h1>前端框架</h1>
        <ul>
          {
            data.map((item, index) => {
              // 遍历时，列表要有一个唯一的key
              return <li key={index}>{item}</li>
            })
          }
        </ul>
      </div>
    )

    ReactDOM.render(VDOM, document.getElementById('test'))
  </script>
</body>

</html>